Add missing & caps.Pure bounds to the ClassTagSeqFactory family#26224
Open
bvenners wants to merge 1 commit into
Open
Add missing & caps.Pure bounds to the ClassTagSeqFactory family#26224bvenners wants to merge 1 commit into
& caps.Pure bounds to the ClassTagSeqFactory family#26224bvenners wants to merge 1 commit into
Conversation
natsukagami
approved these changes
Jun 3, 2026
Contributor
natsukagami
left a comment
There was a problem hiding this comment.
This makes sense. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
& caps.Pureto theCCupper bounds of three declarations inlibrary/src/scala/collection/Factory.scala:trait ClassTagSeqFactoryclass ClassTagSeqFactory.Delegatetrait StrictOptimizedClassTagSeqFactoryThis brings them in line with their non-
ClassTagcounterparts, whichalready carry the bound:
SeqFactory,SeqFactory.Delegate,StrictOptimizedSeqFactoryClassTagSeqFactory.AnySeqDelegateWhy
Factory.scalais compiled withimport language.experimental.captureChecking.When the capture-checked collections were ported in #23769, the
& caps.Purebound was added to the
SeqFactoryfamily and toAnySeqDelegate, but theparallel
ClassTagSeqFactoryfamily was left without it. The inconsistency waslatent until the purity checks were tightened in #26085 ("Tighten check of field
classifiers") and #26097 ("Don't assume classes with self aliases to be pure").
The companion stdlib patch in #26097 (commit 8748bb9, "Fix stdlib") covered other
spots but missed this family.
With the tightened checker, recompiling the capture-checked stdlib now fails on
these three declarations because their
CCparameter is passed to a context thatrequires
... & caps.Pure.How to reproduce
sbt scala3-bootstrapped/testCompilation
fails before this change and passes after it.
Notes
Pure type-bound consistency fix; no behavioral change.